import debug_toolbar
from django.contrib import admin
from django.urls import path, include

from wagtail.admin import urls as wagtailadmin_urls
from wagtail import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls

from django.conf import settings
from django.conf.urls.static import static

from search import views as search_views

from .api import api_router

urlpatterns = [
    path("search/", search_views.search, name="search"),
    path("django-admin/", admin.site.urls),
    path("api/v2/", api_router.urls),
    path("__debug__/", include(debug_toolbar.urls)),

    path('admin/', include(wagtailadmin_urls)),
    path('documents/', include(wagtaildocs_urls)),
    path('', include(wagtail_urls)),



] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
